



//加一个页面刚开始 导入数据

$(function(){
	var spc=[];  //购物车
	$(".gao").hide();
	$(".shanchu").click(function(){
		$(".div3").hide();
		$(".gao").show();
	});
	$('#js').click(function(){
		var qian=$("#qian").text();
		if(qian>0){
			var name=$("#spname").text();
			var s=[];
			var num=$("#num").text();
			var obj={name:name,money:qian,shuliang:num,shouhuo:s}
			var user=JSON.parse(localStorage.getItem("admin"));
			user[0].gwc.push(obj);;
			localStorage.setItem("admin",JSON.stringify(user));
			location="收货地址.html";
		}else{
			alert("请选择一件商品!");
		}
		return false;
	})
});
            var moneys=330;
			var jianshu=1;
			var money=330.00; //价格
			function jia(){
				var num=parseInt(document.getElementById("num").innerHTML)
				var nums=num+1;
				document.getElementById("num").innerHTML=nums;
				for(var i=1;i<=nums;i++){
					moneys=money*nums;
				}
				jianshu=jianshu+1;
				var jian=parseInt(document.getElementById("dj").innerHTML)
				document.getElementById("dj").innerHTML=nums;
				document.getElementById("qian").innerHTML=moneys+".00";
			}
			function jian(){
				var num=parseInt(document.getElementById("num").innerHTML)
				var nums=num-1;
				if(nums<1){
					alert("不能再减了，再减就没有啦！")
					nums++;
				}
				document.getElementById("num").innerHTML=nums;
				for(var i=1;i<=nums;i++){
					moneys=money*nums;
				}
				jianshu=jianshu-1;
				var jian=parseInt(document.getElementById("dj").innerHTML)
				document.getElementById("dj").innerHTML=nums;
				document.getElementById("qian").innerHTML=moneys+".00";
			}
			onload=function(){
				var checkbox = document.getElementsByClassName('color-input-red');
				checkbox.value==1?checkbox.value=2 : checkbox.value=1;
				var checkboxs = document.getElementsByName('color-input-red');
				for(var i=0;i<checkboxs.length;i++){
					checkboxs[i].checked=true;
				}
				var dj=document.getElementById("dj");
				var dj2=document.getElementById("dj2");
				var qian=document.getElementById("qian")
				for(var i=0; i<checkboxs.length;i++){
					if(checkbox.value==1){
					checkboxs[i].checked=true;
					dj.innerHTML=1;
					dj2.innerHTML="以满足59包邮";
					qian.innerHTML=moneys+".00";
					}else{
					checkboxs[i].checked=false;
					dj.innerHTML=jianshu;
					dj2.innerHTML="再购￥59.00免邮，去凑单>";
					}
				}
			}
			function fx(){
				var checkbox = document.getElementsByClassName('color-input-red');
				checkbox.value==1?checkbox.value=2 : checkbox.value=1;
				var checkboxs = document.getElementsByName('color-input-red');
				for(var i=0;i<checkboxs.length;i++){
					checkboxs[i].checked=true;
				}
				var dj=document.getElementById("dj");
				var dj2=document.getElementById("dj2");
				var qian=document.getElementById("qian")
				for(var i=0; i<checkboxs.length;i++){
					if(checkbox.value==1){
					checkboxs[i].checked=true;
					dj.innerHTML=jianshu;
					dj2.innerHTML="以满足59包邮";
					qian.innerHTML=moneys+".00";
					}else{
					checkboxs[i].checked=false;
					dj.innerHTML="0";
					dj2.innerHTML="再购￥59.00免邮，去凑单>";
					qian.innerHTML="0.00";
					}
				}
			}